function initDatepicker(pickid,val){	
	var pick = $( "#"+pickid );
		pick.datepicker(
				{showButtonPanel: true,
					changeMonth: true,
			        changeYear: true,
				dateFormat: 'yy-mm' ,
				yearRange: '2012:2016',
				onClose : function(dateText, inst) { 
	                var month = $("#ui-datepicker-div .ui-datepicker-month :selected").val();
	                var year = $("#ui-datepicker-div .ui-datepicker-year :selected").val();
	                $(this).datepicker('setDate', new Date(year, month, 1));
	            },
	            beforeShow : function(input, inst) {
	                if ((datestr = $(this).val()).length > 0) {
	                	
	                	
	                	year = datestr.substring(0, 4);  
		                month = parseInt( datestr.substring(5, 7)) - 1; 
		               
		                pick.datepicker('option', 'defaultDate', new Date(year, month, 1));
		                pick.datepicker('setDate', new Date(year, month, 1));
	                }
	            }
	            }).val(val);
	};